<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<!DOCTYPE html>
<html>
<head>
<title>plan管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(function() {
		var defHeight = 300, wh = $(window).height();
		var lh = $('.location').height(), fh = $('#floatHead').height(), sh = $(
				'.det-list').height(), ph = $('.pagelist').height();
		defHeight = (wh - lh - fh - sh - ph - 130);
		$('.flexgrid').flexigrid({
			striped : true,
			height : defHeight
		});
	});

	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}

	function deleteAll() {
		var ids = [];//定义一个数组    
		$('input[name="checkall"]:checked').each(function() {
			ids.push($.trim($(this).val()));
		});
		document.location.href = '${ctx}/bt/plan/delete?ids=' + ids;
	}
</script>
</head>
<body>
	<sys:message content="${message}" />
	<!--导航栏-->
	<div class="location">
		<a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
		<a href="${ctx}/center" class="home"><i></i> <span>首页</span></a> <i
			class="arrow"></i> <span>plan管理</span>
	</div>
	<!--/导航栏-->

	<!--工具栏-->
	<div id="floatHead" class="toolbar-wrap">
		<div class="toolbar">
			<div class="box-wrap">
				<a class="menu-btn"></a>
				<div class="l-list">
					<ul class="icon-list">
						<li><a class="all" href="javascript:;"
							onclick="checkAll(this);"><i></i><span>全选</span></a></li>
						<li><a id="btnDelete" class="del"
							href="${ctx}/bt/plan/delete?id=${plan.id}"
							onclick="return confirma('确认要删除该plan吗？', deleteAll)"><i></i><span>删除</span></a></li>
					</ul>
				</div>
				<div class="r-list" style="display: none;">
					<input name="txtKeywords" type="text" id="txtKeywords"
						class="keyword" /> <a id="lbtnSearch" class="btn-search"
						href="javascript:void(0)">查询</a>
				</div>
			</div>
		</div>
	</div>
	<!--/工具栏-->

	<!--搜索栏-->
	<form:form id="searchForm" modelAttribute="plan"
		action="${ctx}/bt/plan/view" method="post">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${page.pageSize}" />
		<div class="det-list clearfix">
			<div class="group btm">
				<div class="control">
					<div class="title">计划id</div>
					<form:input path="id" htmlEscape="false" cssClass="input normal" />
				</div>
				<div class="control">
					<div class="title">计划名称</div>
					<form:input path="planName" htmlEscape="false"
						cssClass="input normal" />
				</div>
			</div>
			<div class="group searchbtn">
				<div class="btn-list">
					<input type="submit" name="btnDetailedSearch" value="查询"
						id="btnDetailedSearch" class="btn"> <input
						name="btnReturn" type="reset" value="重置" class="btn yellow">
				</div>
			</div>
			<div style="clear: both;"></div>
		</div>
	</form:form>
	<!--/搜索栏-->

	<!--列表-->
	<div class="table-container">
		<table class="flexgrid">
			<thead>
				<tr>
					<th width="25">选择</th>
					<th width="120">计划id</th>
					<th width="120">计划名称</th>
					<th width="120">分配编码</th>
					<th width="120">创建时间</th>
					<th width="120">数量</th>
					<th width="120">调用方式</th>
					<th width="120">状态</th>
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${page.list}" var="plan">
					<tr>
						<td style="text-align: center;"><span class="checkall"
							style="vertical-align: middle;"> <input type="checkbox"
								name="checkall" value="${plan.id}" />
						</span> <%-- <input type="hidden" name="checkall" value="${plan.id}" /> --%>
						</td>
						<td>${plan.id}</td>
						<td>${plan.planName}</td>
						<td>${plan.distributeCode}</td>
						<td>${plan.createTime}</td>
						<td>${plan.counts}</td>
						<td>${plan.invokeMethod}</td>
						<td><c:choose><c:when test="${plan.status == 1}">运行</c:when> <c:otherwise>中止</c:otherwise></c:choose></td>
						<td align="center"><a
							href="${ctx}/bt/plan/form?id=${plan.id}">修改</a>&nbsp;|&nbsp; <a
							href="${ctx}/bt/plan/delete?id=${plan.id}"
							onclick="return confirmx('确认要删除该plan吗？', this.href)">删除</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
	<!--/列表-->

	<!--内容底部-->
	<div class="line10"></div>
	<div class="pagelist">${page}</div>
	<!--/内容底部-->
</body>
</html>
